<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>确认订单</title>

    <link rel="stylesheet" href="/templates/index/vendors/font-awesome/4.5.0/css/font-awesome.min.css">
    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/??sm.min.css,sm-extend.min.css">
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/??sm.min.js,sm-extend.min.js' charset='utf-8'></script>
    <link rel="stylesheet" href="/templates/index/css/order.css">
</head>
<body>
<div class="page-group">
    <div class="page page-current">
        <header class="bar bar-nav">
            <a href="javascript:history.back(-1);" class="icon icon-left pull-left"></a>
            <h1 class="title">确认订单</h1>
        </header>
        <div class="content native-scroll">
            <div class="content-block-title">收货地址：{$address_info.city_name}{$address_info.area_name}{$address_info.area_info}{$address_info.address}</div>
            <div class="list-block">
                <ul>
                    <li class="item-content">
                        <div class="item-inner">
                            <input type="hidden" value="{$address_info.address_id}" id="address_id" >
                            <div class="item-title">收货人：{$address_info.true_name}</div>
                            <div class="item-after">{$address_info.mob_phone}</div>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="content-block-title">产品信息</div>
            <div class="list-block media-list">
                <ul>
                    {foreach $cart_list as $cart_info}
                    <li>
                        <div class="item-content">
                            <div class="item-media">
                                <img src="http://gqianniu.alicdn.com/bao/uploaded/i4//tfscom/i3/TB10LfcHFXXXXXKXpXXXXXXXXXX_!!0-item_pic.jpg_250x250q60.jpg" width="80">
                            </div>
                            <div class="item-inner">
                                <div class="item-title-row">
                                    <div class="item-title">{$cart_info.goods_name}</div>
                                    <div class="item-after">
                                        数量X{$cart_info.goods_num}<br>
                                        ￥{$cart_info.goods_price}
                                    </div>
                                </div>
                                <!--<div class="item-subtitle">标题</div>-->
                                <!--<div class="item-text">{$cart_info.goods_name}</div>-->
                            </div>
                        </div>
                    </li>
                    {/foreach}
                </ul>
            </div>
        </div>
        <nav class="bar bar-tab">
            <a class="tab-item external active" href="#">
                共1件
            </a>
            <a class="tab-item external" href="#">
                总金额￥{$cart_info.goods_price}
            </a>
            <a class="tab-item external" href="#" id="saveOrder">
                提交订单
            </a>
        </nav>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        $('#saveOrder').click(function(){
            var data = {
              address_id: $('#address_id').val()
            };
            $.post('/index/order/save',data,function(result){
                if(result.code == 1){
                    location.href=result.url;
                }else{
                    $.alert(result.msg);
                }
            },'json');
        });
    });
</script>
</body>
</html>